package com.wing.wcabinet.model.entity;

import java.io.Serializable;

import com.alibaba.cloud.commons.lang.StringUtils;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.enums.IEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.wing.cabinet.model.entity.UseInventoryInout;
import com.wing.mybatis.common.BaseEntity;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 盘验结果表
 *
 * @author
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("wcab_checked_result")
public class WcabCheckedResult extends BaseEntity<WcabCheckedResult> implements Serializable {

    private static final long serialVersionUID = 1L;

    public enum Status implements IEnum<Integer> {

        /**
        * 已盘验
        */
        checked(1,"已盘验"),
        /**
        * 已生成订单
        */
        genOrder(2,"已生成订单"),
        /**
        * 已通知
        */
        notified(3,"已通知");

        private int code;
        private String desc;

        Status(int code,String desc){
            this.code=code;
            this.desc=desc;
        }

        @Override
        public Integer getValue(){
            return this.code;
        }

        public String getDesc(){
            return this.desc;
        }
    }

    public enum BusinessType implements IEnum<Integer> {

        /**
        * 可用
        */
        normal(1,"可用"),
        /**
        * 维修
        */
        repair(2,"维修"),
        /**
        * 回收/报废
        */
        recycle(3,"回收/报废");

        private int code;
        private String desc;

        BusinessType(int code,String desc){
            this.code=code;
            this.desc=desc;
        }

        @Override
        public Integer getValue(){
            return this.code;
        }

        public String getDesc(){
            return this.desc;
        }

        @JsonCreator
        public static BusinessType jsonCreator(String name) {
            if (StringUtils.isNotBlank(name)) {
                for (BusinessType item : values()) {
                    if (item.name().equals(name.trim())) {
                        return item;
                    }
                }
            }
            return null;
        }
    }

    public enum BusinessTypePre implements IEnum<Integer> {

        /**
         * 可用
         */
        nomal(1,"可用"),
        /**
         * 维修
         */
        repair(2,"维修"),
        /**
         * 回收/报废
         */
        recycle(3,"回收/报废");

        private int code;
        private String desc;

        BusinessTypePre(int code,String desc){
            this.code=code;
            this.desc=desc;
        }

        @Override
        public Integer getValue(){
            return this.code;
        }

        public String getDesc(){
            return this.desc;
        }

        @JsonCreator
        public static BusinessTypePre jsonCreator(String name) {
            if (StringUtils.isNotBlank(name)) {
                for (BusinessTypePre item : values()) {
                    if (item.name().equals(name.trim())) {
                        return item;
                    }
                }
            }
            return null;
        }
    }

    private BusinessTypePre businessTypePre;

    /**
     * 创建者
     */
    private Long creator;

    /**
     * 修改者
     */
    private Long modifier;

    /**
     * 创建人
     */
    private String creatorName;

    /**
     * 修改人
     */
    private String modifierName;

    /**
     * 状态
     */
    private Status status;

    /**
    * 状态描述
    */
    @TableField(exist = false)
    private String statusDesc;

    public String getStatusDesc() {
        return status == null ? null : status.getDesc();
    }

    /**
     * 货物状态
     */
    private BusinessType businessType;

    /**
    * 货物状态描述
    */
    @TableField(exist = false)
    private String businessTypeDesc;

    public String getBusinessTypeDesc() {
        return businessType == null ? null : businessType.getDesc();
    }

    /**
     * 盘验数量
     */
    private Integer quantity;

    /**
     * 重量
     */
    private BigDecimal weight;

    /**
     * 车间id
     */
    private Long workshopId;

    /**
     * 车间名称
     */
    private String workshopName;

    /**
    * 通知时间
    */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime notifyTime;

    /**
     * 通知用户
     */
    private Long notifyUserId;

    /**
     * 序号
     */
    private Integer no;

    /**
     * 日期
     */
    private Integer day;

    /**
     * 编号
     */
    private String code;

    /**
     * 通知人
     */
    private String notifyUserName;

    /**
     * 通知供应商id
     */
    private Long supplierId;

    /**
     * 通知供应商
     */
    private String supplierName;

    /**
     * 企业id
     */
    private Long companyId;


    /**
     * 是否已经生成订单
     */
    private Boolean isGenOrder;

    /**
     * 是否同步
     */
    private Boolean isSync;

    /**
     * 是否相符，0：否，1：是
     */
    private Boolean isCorrect;

    /**
     * supplierCompanyId
     */
    private String supplierCompanyId;

    /**
     * 是否已经存到维修,0:否，1：是
     */
    private Boolean isStorage;

    /**
     * 盘验任务id
     */
    private Long checkId;

    /**
     * 不符合分类id
     */
    private Long categoryId;

    /**
     * enterpriseId
     */
    private Long enterpriseId;

    /**
     * enterpriseCode
     */
    private String enterpriseCode;


    private String cabCode;

    private String spaceCode;

    private String skuCode;

    private Boolean skuCorrect;

    private Boolean businessTypeCorrect;

    private Boolean weightCorrect;

    private Boolean quantityCorrect;

    private String skuCodeChecked;

    private String departmentName;

    private String roleName;
    /**
     * 渠道编号
     */
    private String channelCode;
}
